package com.clarte.common.action;

import java.util.Map;

import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
@Controller
public class LoginInterceptor extends AbstractInterceptor {

	@Override
	public String intercept(ActionInvocation inv) throws Exception {
		Map<String,Object> session = inv.getInvocationContext().getSession();
		if (session != null && session.get("user") != null)
			return inv.invoke();
		else
			return "login";
	}

}
